import request from "../../utils/request.js"

const api_name = "/admin/product/"

export default {
    ///admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
    getAttrInfoList(category1Id,category2Id,category3Id){
        return request.get(`${api_name}/attrInfoList/${category1Id}/${category2Id}/${category3Id}`)
    },

    // DELETE /admin/product/deleteAttr/{attrId}
    deleteAttr(attrId){
        return request.delete(`${api_name}/deleteAttr/${attrId}`)
    },

    // GET /admin/product/getAttrValueList/{attrId}
    getAttrValueList(attrId){
        return request.get(`${api_name}/getAttrValueList/${{attrId}}`)
    },

   /*{
        "attrName": "string",
        "attrValueList": [
          {
            "attrId": 0,
            "id": 0,
            "valueName": "string"
          }
        ],
        "categoryId": 0,
        "categoryLevel": 0,
        "id": 0
        */
    //POST /admin/product/saveAttrInfo
    addOrUpdateAttr(attr){
        return request.post(`${api_name}/saveAttrInfo`,attr)
    }

}